import { createApp } from 'vue';
import App from './App.vue';
import 'ant-design-vue/dist/antd.css';
import 'virtual:windi.css';
import { setupStore } from '/@/store/index';
import { setupI18n } from '/@/locales/setupI18n';
import { router, setupRouter } from './router';
import { registerGlobComp } from './components/registerGlobComp';
import setupRouterGuard from './router/guard/index';
import registerGlobDirective from './utils/registerGlobDirective';
import importLogo from './utils/iconify/logoBundles';
import { replaceLogoAndName } from './views/sys/login/useLogin';

async function bootstrap() {
  const app = createApp(App);

  importLogo();

  setupStore(app);

  registerGlobComp(app);

  registerGlobDirective(app);

  await setupI18n(app);

  setupRouter(app);

  setupRouterGuard(router);

  replaceLogoAndName();

  app.mount('#app');
}

bootstrap();
